public class Solution1455 {
    public int isPrefixOfWord(String sentence, String searchWord) {
        String[] w=sentence.split(" ");
        for (int i=0;i<w.length;i++){
            if (w[i].startsWith(searchWord)){
                return i+1;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1455().isPrefixOfWord("i love eating burger","burg"));
    }
}
